package com.omg.persistence.delegate.lifepoint;

import java.util.List;

import com.ibatis.dao.client.DaoManager;
import com.omg.persistence.dao.lifepoint.DaoConfig;
import com.omg.persistence.dao.lifepoint.entity.LPFriendRequest;
import com.omg.persistence.dao.lifepoint.iface.LPFriendRequestDao;

public class LPFriendRequestDelegate {

	private static volatile LPFriendRequestDelegate instance;
	private LPFriendRequestDao lpFriendRequestDao;
	private static final Object synObj = new Object();

	public static LPFriendRequestDelegate getInstance() {
		if (instance == null) {
			instance = new LPFriendRequestDelegate();
		}
		return instance;
	}

	private LPFriendRequestDelegate() {
		synchronized (synObj) {
			DaoManager daoMgr = DaoConfig.getDaoManager();
			this.lpFriendRequestDao = (LPFriendRequestDao) daoMgr
					.getDao(LPFriendRequestDao.class);
		}
	}

	public List<LPFriendRequest> getFriendRequestsByUseridAndIsnew(String userid,
			boolean isnew) {
		return this.lpFriendRequestDao.getFriendRequestsByUseridAndIsnew(
				userid, isnew);
	}

}
